package com.leetcode.test.linklist;

public class ListNode {
    public int      val;
    public ListNode next;

    public ListNode(int x) {
        val = x;
        next = null;
    }

    @Override
    public String toString() {
        return "{" +
                "val=" + val +
                (next == null ? "" : (", next=" + next.val)) +
                '}';
    }
}